hex
Hex text codec.
Naming convention: import the module under its bare name (
import "hex"), reach members with a backslash, and call methods incamelCase:hex\someMethod.
Methods
encode
Encode data as lowercase hex.
Signature: hex\encode(data) -> string - source
| Parameter | Type | Optional | Description |
|---|---|---|---|
data |
string |
Returns: string
decode
Decode a hex string; errors on malformed input.
Signature: hex\decode(s) -> string - source
| Parameter | Type | Optional | Description |
|---|---|---|---|
s |
string |
Returns: string