Karakter null

Karakter null (atau bita null), disingkat NUL atau NULL, adalah sebuah karakter kontrol yang bernilai kosong.[1][2][3][4] Karakt…

Karakter null (atau bita null), disingkat NUL atau NULL, adalah sebuah karakter kontrol yang bernilai kosong.[1][2][3][4] Karakter tersebut tersedia dalam kebanyakan sistem karakter, seperti ISO/IEC 646 (atau ASCII), kontrol kode C0, Unicode, dan EBCDIC. Karakter null juga tersedia pada kebanyakan bahasa pemrograman.[5]

Ketika karakter tersebut dikirimkan ke pencetak atau sebuah terminal, baik pencetak maupun terminal tidak melakukan operasi apa pun (beberapa terminal mencetak karakter ini sebagai spasi). Ketika teleprinter elektromekanikal digunakan sebagai keluaran komputer, karakter null dikirimkan untuk mengembalikan kursor ke posisi awal pada baris berikutnya. Pada punched card, karakter diwakili dengan bagian kartu yang tidak berlubang. Sehingga, kartu yang baru dipenuhi dengan karakter null (karena tidak ada lubang sama sekali pada permukaannya), dan karakter lain dapat dicetak di atas kartu tersebut dengan melubangi kartu tersebut (sekaligus mengganti karakter null dengan karakter yang diinginkan).

Karakter tersebut mempunyai peran penting dalam bahasa C serta keturunannya, karena karakter tersebut menandakan akhir dari string.[6]

Representasi

Pada banyak kasus, karakter null ditulis \0, garis miring terbalik diikuti dengan angka nol.[7] Pada kasus yang lain, karakter tersebut ditulis \000, \x00, \z, atau \u0000. Karakter null dapat ditaruh pada URL dengan kode %00.

Pada beberapa program, karakter null akan diinterpretasikan sebagai ujung dari string. Namun, penggunaan karakter tersebut membuka celah keamanan yang disebut null byte injection dan membuka risiko keamanan dari program yang bersangkutan.[8]

Pada Unicode, karakter untuk menggambarkan null adalah "symbol for null", U+2400 (␀). Sementara karakter yang asli terletak pada U+0000.

Catatan kaki

  1. ^ ASCII format for Network Interchange. IETF. sec. 5.2. doi:10.17487/RFC0020. RFC 20. https://tools.ietf.org/html/rfc20#section-5.2. "NUL (Null): The all-zeros character which may serve to accomplish time fill and media fill." 
  2. ^ "The set of control characters of the ISO 646" (PDF). Secretariat ISO/TC 97/SC 2. 1975-12-01. hlm. 4.4. Diarsipkan dari asli (PDF) tanggal 2014-05-12. Position: 0/0, Name: Null, Abbreviation: Nul {{cite web}}:
  3. ^ "Unicode Character 'NULL' (U+0000)". Diakses tanggal 2018-10-20.
  4. ^ "C0 Controls and Basic Latin" (PDF). Unicode Consortium. 2018. Diakses tanggal 2018-10-20.
  5. ^ "A byte with all bits set to 0, called the null character, shall exist in the basic execution character set; it is used to terminate a character string literal." — ANSI/ISO 9899:1990 (the ANSI C standard), section 5.2.1
  6. ^ "A string is a contiguous sequence of characters terminated by and including the first null character" — ANSI/ISO 9899:1990 (the ANSI C standard), section 7.1.1
  7. ^ Kernighan and Ritchie, C, p. 38
  8. ^ Null Byte Injection WASC Threat Classification Null Byte Attack section.

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.