Page tree
Skip to end of metadata
Go to start of metadata

Converts a string to EDCDIC hex.

  1. String
  2. Length to pad to (optional)
Return Value

This API returns a JavaScript Buffer object. The length of the buffer is determined by the parameters. If the String value length is less than the length provided, the buffer is padded with blanks. If the String value length is longer than the length provided, only the characters up to the specified length are converted.

Exception Handling

If you pass in an incorrect hex value, the Buffer module can throw an error.

var myBuff = String.toEbcdicHex('Hello world');
var myString = String.fromEbcdicHex(myBuff.toString('hex'));