Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 3 Next »

Convert a string to EDCDIC hex.

Parameters
  1. String
  2. 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'));


 

  • No labels