Built-In Namespace global__
| Method Attributes | Method Name and Description |
|---|---|
|
ArrayBuffertohex(buffer)
convert a ArrayBuffer to a hexadecimal string
This function converts from a ArrayBuffer to a hexadecimal string. |
|
|
b64nltohex(s)
convert a Base64 encoded string with new lines to a hexadecimal string
This function converts from a Base64 encoded string with new lines to a hexadecimal string. |
|
|
b64tob64u(s)
convert a Base64 encoded string to a Base64URL encoded string.
|
|
|
b64toutf8(s)
convert a Base64 encoded string to a UTF-8 encoded string including CJK or Latin.
|
|
|
b64utob64(s)
convert a Base64URL encoded string to a Base64 encoded string.
|
|
|
b64utohex(s)
convert a Base64URL encoded string to a hexadecimal string.
|
|
|
b64utos(s)
convert a Base64URL encoded string to a ASCII string.
|
|
|
b64utoutf8(s)
|
|
|
BAtohex(a)
convert an array of bytes(Number) to hexadecimal string.
|
|
|
BAtos(a)
convert an array of character codes to a string
|
|
|
convert UTFa hexadecimal string to a URLComponent string such like "%67%68".
|
|
|
hextoArrayBuffer(hex)
convert a ArrayBuffer to a hexadecimal string
This function converts from a ArrayBuffer to a hexadecimal string. |
|
|
hextob64(s)
convert a hexadecimal string to Base64 encoded string
This function converts from a hexadecimal string to Base64 encoded string without new lines. |
|
|
hextob64nl(s)
convert a hexadecimal string to Base64 encoded string with new lines
This function converts from a hexadecimal string to Base64 encoded string with new lines for each 64 characters. |
|
|
hextob64u(s)
convert a hexadecimal string to a Base64URL encoded string.
|
|
|
hextorstr(s)
convert a hexadecimal encoded string to raw string including non printable characters.
|
|
|
hextouricmp(s)
convert a hexadecimal string to a URLComponent string such like "%67%68".
|
|
|
hextoutf8(s)
convert a hexadecimal encoded string to a UTF-8 encoded string including CJK or Latin.
|
|
|
convert string of integer array to hexadecimal string.
|
|
|
convert all UNIX new line("\r\n") to DOS new line("\n") in
a String "s".
|
|
|
convert all DOS new line("\r\n") to UNIX new line("\n") in
a String "s".
|
|
|
readFile(binFile)
read file and return file contents
This function only works in Node.js.
|
|
|
readFileHexByBin(binFile)
read binary file and return file contents as hexadecimal string
This function only works in Node.js.
|
|
|
readFileUTF8(utf8File)
read file and return file contents as utf-8 string
This function only works in Node.js.
|
|
|
rstrtohex(s)
convert a raw string including non printable characters to hexadecimal encoded string.
|
|
|
saveFile(binFile, rawString)
save raw string to file
This function only works in Node.js.
|
|
|
saveFileBinByHex(binFile, hexString)
save data represented by hexadecimal string to file
This function only works in Node.js.
|
|
|
stob64(s)
convert a ASCII string to a Base64 encoded string.
|
|
|
stob64u(s)
convert a ASCII string to a Base64URL encoded string.
|
|
|
stoBA(s)
convert a string to an array of character codes
|
|
|
stohex(s)
convert a ASCII string to a hexadecimal string of ASCII codes.
|
|
|
strdiffidx(s1, s2)
find index of string where two string differs
|
|
|
uricmptohex(s)
convert a URLComponent string such like "%67%68" to a hexadecimal string.
|
|
|
utf8tob64(s)
convert a UTF-8 encoded string including CJK or Latin to a Base64 encoded string.
|
|
|
utf8tob64u(s)
|
|
|
utf8tohex(s)
convert a UTF-8 encoded string including CJK or Latin to a hexadecimal encoded string.
|
Method Detail
{String}
ArrayBuffertohex(buffer)
convert a ArrayBuffer to a hexadecimal string
This function converts from a ArrayBuffer to a hexadecimal string.
Defined in: base64x-1.1.js.
This function converts from a ArrayBuffer to a hexadecimal string.
Defined in: base64x-1.1.js.
hextoArrayBuffer("fffa01") → ArrayBuffer of [255, 250, 1]
- Parameters:
- {ArrayBuffer} buffer
- ArrayBuffer
- Since:
- jsrsasign 6.1.4 base64x 1.1.8
- Returns:
- {String} hexadecimal string
{String}
b64nltohex(s)
convert a Base64 encoded string with new lines to a hexadecimal string
This function converts from a Base64 encoded string with new lines to a hexadecimal string. This is useful to handle PEM encoded file. This function removes any non-Base64 characters (i.e. not 0-9,A-Z,a-z,\,+,=) including new line.
Defined in: base64x-1.1.js.
This function converts from a Base64 encoded string with new lines to a hexadecimal string. This is useful to handle PEM encoded file. This function removes any non-Base64 characters (i.e. not 0-9,A-Z,a-z,\,+,=) including new line.
Defined in: base64x-1.1.js.
hextob64nl( "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4\r\n" + "OTAxMjM0NTY3ODkwCg==\r\n") → "123456789012345678901234567890123456789012345678901234567890"
- Parameters:
- {String} s
- Base64 encoded string with new lines
- Since:
- base64x 1.1.3
- Returns:
- {String} hexadecimal string
{String}
b64tob64u(s)
b64tob64u("ab+c3f/==") → "ab-c3f_"
- Parameters:
- {String} s
- Base64 encoded string
- Returns:
- {String} Base64URL encoded string
{String}
b64toutf8(s)
convert a Base64 encoded string to a UTF-8 encoded string including CJK or Latin.
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
- Parameters:
- {String} s
- Base64 encoded string
- Since:
- 1.1.1
- Returns:
- {String} UTF-8 encoded string
{String}
b64utob64(s)
b64utob64("ab-c3f_") → "ab+c3f/=="
- Parameters:
- {String} s
- Base64URL encoded string
- Returns:
- {String} Base64 encoded string
{String}
b64utohex(s)
- Parameters:
- {String} s
- Base64URL encoded string
- Returns:
- {String} hexadecimal string
{String}
b64utos(s)
convert a Base64URL encoded string to a ASCII string.
NOTE: This can't be used for Base64URL encoded non ASCII characters.
Defined in: base64x-1.1.js.
NOTE: This can't be used for Base64URL encoded non ASCII characters.
Defined in: base64x-1.1.js.
- Parameters:
- {s} s
- Base64URL encoded string
- Returns:
- {String} ASCII string
b64utoutf8(s)
Defined in: base64x-1.1.js.
- Parameters:
- s
{String}
BAtohex(a)
- Parameters:
- {Array of Numbers} a
- array of bytes
- Returns:
- {String} hexadecimal string
{String}
BAtos(a)
convert an array of character codes to a string
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
- Parameters:
- {Array of Numbers} a
- array of character codes
- Returns:
- {String} s
{String}
encodeURIComponentAll(s)
convert UTFa hexadecimal string to a URLComponent string such like "%67%68".
Note that these "
Defined in: base64x-1.1.js.
Note that these "
0-9A-Za-z!'()*-._~" characters will not
converted to "%xx" format by builtin 'encodeURIComponent()' function.
However this 'encodeURIComponentAll()' function will convert
all of characters into "%xx" format.
Defined in: base64x-1.1.js.
- Parameters:
- {String} s
- hexadecimal string
- Since:
- 1.1
- Returns:
- {String} URIComponent string such like "%67%68"
{ArrayBuffer}
hextoArrayBuffer(hex)
convert a ArrayBuffer to a hexadecimal string
This function converts from a ArrayBuffer to a hexadecimal string.
Defined in: base64x-1.1.js.
This function converts from a ArrayBuffer to a hexadecimal string.
Defined in: base64x-1.1.js.
var buffer = new ArrayBuffer(3); var view = new DataView(buffer); view.setUint8(0, 0xfa); view.setUint8(1, 0xfb); view.setUint8(2, 0x01); ArrayBuffertohex(buffer) → "fafb01"
- Parameters:
- {String} hex
- hexadecimal string
- Since:
- jsrsasign 6.1.4 base64x 1.1.8
- Returns:
- {ArrayBuffer} ArrayBuffer
{String}
hextob64(s)
convert a hexadecimal string to Base64 encoded string
This function converts from a hexadecimal string to Base64 encoded string without new lines.
Defined in: base64x-1.1.js.
This function converts from a hexadecimal string to Base64 encoded string without new lines.
Defined in: base64x-1.1.js.
hextob64("616161") → "YWFh"
- Parameters:
- {String} s
- hexadecimal string
- Since:
- base64x 1.1.3
- Returns:
- {String} resulted Base64 encoded string
{String}
hextob64nl(s)
convert a hexadecimal string to Base64 encoded string with new lines
This function converts from a hexadecimal string to Base64 encoded string with new lines for each 64 characters. This is useful for PEM encoded file.
Defined in: base64x-1.1.js.
This function converts from a hexadecimal string to Base64 encoded string with new lines for each 64 characters. This is useful for PEM encoded file.
Defined in: base64x-1.1.js.
hextob64nl("123456789012345678901234567890123456789012345678901234567890")
→
MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4 // new line
OTAxMjM0NTY3ODkwCg==
- Parameters:
- {String} s
- hexadecimal string
- Since:
- base64x 1.1.3
- Returns:
- {String} resulted Base64 encoded string with new lines
{String}
hextob64u(s)
convert a hexadecimal string to a Base64URL encoded string.
convert a hexadecimal string to a Base64URL encoded string. NOTE: If leading "0" is omitted and odd number length for hexadecimal leading "0" is automatically added.
Defined in: base64x-1.1.js.
convert a hexadecimal string to a Base64URL encoded string. NOTE: If leading "0" is omitted and odd number length for hexadecimal leading "0" is automatically added.
Defined in: base64x-1.1.js.
- Parameters:
- {String} s
- hexadecimal string
- Returns:
- {String} Base64URL encoded string
{String}
hextorstr(s)
convert a hexadecimal encoded string to raw string including non printable characters.
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
hextorstr("610061") → "a\x00a"
- Parameters:
- {String} s
- hexadecimal encoded string
- Since:
- 1.1.2
- Returns:
- {String} raw string
{String}
hextouricmp(s)
convert a hexadecimal string to a URLComponent string such like "%67%68".
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
- Parameters:
- {String} s
- hexadecimal string
- Since:
- 1.1
- Returns:
- {String} URIComponent string such like "%67%68"
{String}
hextoutf8(s)
convert a hexadecimal encoded string to a UTF-8 encoded string including CJK or Latin.
Note that when input is improper hexadecimal string as UTF-8 string, this function returns 'null'.
Defined in: base64x-1.1.js.
Note that when input is improper hexadecimal string as UTF-8 string, this function returns 'null'.
Defined in: base64x-1.1.js.
- Parameters:
- {String} s
- hexadecimal encoded string
- Since:
- 1.1.1
- Returns:
- {String} UTF-8 encoded string or null
{String}
intarystrtohex(s)
convert string of integer array to hexadecimal string.
This function converts a string of JavaScript integer array to a hexadecimal string. Each integer value shall be in a range from 0 to 255 otherwise it raise exception. Input string can have extra space or newline string so that they will be ignored.
Defined in: base64x-1.1.js.
This function converts a string of JavaScript integer array to a hexadecimal string. Each integer value shall be in a range from 0 to 255 otherwise it raise exception. Input string can have extra space or newline string so that they will be ignored.
Defined in: base64x-1.1.js.
intarystrtohex(" [123, 34, 101, 34, 58] ")
→ 7b2265223a (i.e. '{"e":' as string)
- Parameters:
- {String} s
- string of integer array
- Since:
- base64x 1.1.6 jsrsasign 5.0.2
- Throws:
- "malformed integer array string: *" for wrong input
- Returns:
- {String} hexadecimal string
{String}
newline_toDos(s)
convert all UNIX new line("\r\n") to DOS new line("\n") in
a String "s".
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
- Parameters:
- {String} s
- string
- Returns:
- {String} converted string
{String}
newline_toUnix(s)
convert all DOS new line("\r\n") to UNIX new line("\n") in
a String "s".
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
- Parameters:
- {String} s
- string
- Returns:
- {String} converted string
{String}
readFile(binFile)
read file and return file contents
This function only works in Node.js.
Defined in: nodeutil-1.0.js.
Defined in: nodeutil-1.0.js.
- Parameters:
- {String} binFile
- file name to be read
- Returns:
- {String} raw string of file contents
{String}
readFileHexByBin(binFile)
read binary file and return file contents as hexadecimal string
This function only works in Node.js.
Defined in: nodeutil-1.0.js.
Defined in: nodeutil-1.0.js.
- Parameters:
- {String} binFile
- file name to be read
- Returns:
- {String} hexadecimal string of file contents
{String}
readFileUTF8(utf8File)
read file and return file contents as utf-8 string
This function only works in Node.js.
Defined in: nodeutil-1.0.js.
Defined in: nodeutil-1.0.js.
- Parameters:
- {String} utf8File
- file name to be read
- Returns:
- {String} utf-8 string of file contents
{String}
rstrtohex(s)
convert a raw string including non printable characters to hexadecimal encoded string.
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
rstrtohex("a\x00a") → "610061"
- Parameters:
- {String} s
- raw string
- Since:
- 1.1.2
- Returns:
- {String} hexadecimal encoded string
saveFile(binFile, rawString)
save raw string to file
This function only works in Node.js.
Defined in: nodeutil-1.0.js.
Defined in: nodeutil-1.0.js.
- Parameters:
- {String} binFile
- file name to save contents.
- {String} rawString
- string contents to be saved.
saveFileBinByHex(binFile, hexString)
save data represented by hexadecimal string to file
This function only works in Node.js.
Defined in: nodeutil-1.0.js.
Defined in: nodeutil-1.0.js.
- Parameters:
- {String} binFile
- file name to save contents.
- {String} hexString
- hexadecimal string to be saved.
{String}
stob64(s)
convert a ASCII string to a Base64 encoded string.
NOTE: This can't be used for non ASCII characters.
Defined in: base64x-1.1.js.
NOTE: This can't be used for non ASCII characters.
Defined in: base64x-1.1.js.
- Parameters:
- {s} s
- ASCII string
- Returns:
- {String} Base64 encoded string
{String}
stob64u(s)
convert a ASCII string to a Base64URL encoded string.
NOTE: This can't be used for non ASCII characters.
Defined in: base64x-1.1.js.
NOTE: This can't be used for non ASCII characters.
Defined in: base64x-1.1.js.
- Parameters:
- {s} s
- ASCII string
- Returns:
- {String} Base64URL encoded string
{Array of Numbers}
stoBA(s)
convert a string to an array of character codes
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
- Parameters:
- {String} s
- Returns:
- {Array of Numbers}
{String}
stohex(s)
convert a ASCII string to a hexadecimal string of ASCII codes.
NOTE: This can't be used for non ASCII characters.
Defined in: base64x-1.1.js.
NOTE: This can't be used for non ASCII characters.
Defined in: base64x-1.1.js.
- Parameters:
- {s} s
- ASCII string
- Returns:
- {String} hexadecimal string
{Number}
strdiffidx(s1, s2)
find index of string where two string differs
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
strdiffidx("abcdefg", "abcd4fg") -> 4
strdiffidx("abcdefg", "abcdefg") -> -1
strdiffidx("abcdefg", "abcdef") -> 6
strdiffidx("abcdefgh", "abcdef") -> 6
- Parameters:
- {String} s1
- string to compare
- {String} s2
- string to compare
- Since:
- jsrsasign 4.9.0 base64x 1.1.5
- Returns:
- {Number} string index of where character differs. Return -1 if same.
{String}
uricmptohex(s)
convert a URLComponent string such like "%67%68" to a hexadecimal string.
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
- Parameters:
- {String} s
- URIComponent string such like "%67%68"
- Since:
- 1.1
- Returns:
- {String} hexadecimal string
{String}
utf8tob64(s)
convert a UTF-8 encoded string including CJK or Latin to a Base64 encoded string.
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
- Parameters:
- {String} s
- UTF-8 encoded string
- Since:
- 1.1.1
- Returns:
- {String} Base64 encoded string
utf8tob64u(s)
Defined in: base64x-1.1.js.
- Parameters:
- s
{String}
utf8tohex(s)
convert a UTF-8 encoded string including CJK or Latin to a hexadecimal encoded string.
Defined in: base64x-1.1.js.
Defined in: base64x-1.1.js.
- Parameters:
- {String} s
- UTF-8 encoded string
- Since:
- 1.1.1
- Returns:
- {String} hexadecimal encoded string