Skip to content

Encode

Overview

String encoding and decoding related functions

md5

Returns the MD5 hash of string s

javascript
Encode.md5(s)
ParameterTypeDescription
sStringThe string to calculate

Return Value

Type String MD5 hash value of string s

Examples

javascript
Encode.md5('123456'); //e10adc3949ba59abbe56e057f20f883e
Encode.md5(null); //null

urlEncode

URL encodes string str

javascript
Encode.urlEncode(str)
ParameterTypeDescription
strStringThe string to encode

Return Value

Type String URL-encoded value of string str

Examples

javascript
Encode.urlEncode('https://next.informat.cn'); //https%3A%2F%2Fnext.informat.cn
Encode.urlEncode(null); //null

urlDecode

URL decodes string str

javascript
Encode.urlDecode(str)
ParameterTypeDescription
strStringThe string to decode

Return Value

Type String URL-decoded value of string str

Examples

javascript
Encode.urlDecode('https%3A%2F%2Fnext.informat.cn'); //https://next.informat.cn
Encode.urlDecode(null); //null