Convert a string to EDCDIC hex.
Parameters
- String
- Length to pad - if null, will use the length of the string value
Return Value
This API returns a JavaScript Buffer object. The length of the buffer is determined by the parameter. If the String value length is less than the length provided, the buffer will be padded with blanks. If the String value length is longer than the length provided, it will only convert the String characters in the length.
Exception Handling
If you pass in the incorrect amount of hex, it is possible that the Buffer module can throw an error.
Example
var myBuff = String.toEbcdicHex('Hello world'); var myString = String.fromEbcdicHex(myBuff.toString('hex'));