struct Char

Overview

A Char represents a Unicode code point. It occupies 32 bits.

It is created by enclosing an UTF-8 character in single quotes.

'a'
'z'
'0'
'_'
'あ'

You can use a backslash to denote some characters:

'\'' # single quote
'\\' # backslash
'\e' # escape
'\f' # form feed
'\n' # newline
'\r' # carriage return
'\t' # tab
'\v' # vertical tab

You can use a backslash followed by an u and four hexadecimal characters to denote a unicode codepoint written:

'\u0041' # == 'A'

Or you can use curly braces and specify up to four hexadecimal numbers:

'\u{41}' # == 'A'

See Char literals in the language reference.

Included Modules

Defined in:

ssz/codec.cr
ssz/hash_tree_root.cr

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

ssz_basic? : Bool ssz_basic?, ssz_encode(io : IO)
ssz_encode : Bytes
ssz_encode
, ssz_fixed? : Bool ssz_fixed?, ssz_size : Int32 ssz_size, ssz_variable? : Bool ssz_variable?

Class methods inherited from class Object

ssz_basic? : Bool ssz_basic?, ssz_decode(io : IO, size : Int32 = 0)
ssz_decode(bytes : Bytes)
ssz_decode
, ssz_fixed? : Bool ssz_fixed?, ssz_variable? : Bool ssz_variable?

Class Method Detail

def self.ssz_basic? : Bool #

[View source]
def self.ssz_decode(io : IO, size : Int32 = 0) #

[View source]
def self.ssz_variable? : Bool #

[View source]

Instance Method Detail

def hash_tree_root : Bytes #

[View source]
def ssz_basic? : Bool #

[View source]
def ssz_encode(io : IO) #

[View source]
def ssz_size : Int32 #

[View source]
def ssz_variable? : Bool #

[View source]