move wordArrayToBuffer to wtvshared
This commit is contained in:
@@ -53,6 +53,16 @@ class WTVShared {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* convert a CryptoJS.lib.WordArray to a Javascript Buffer
|
||||
* @param {CryptoJS.lib.WordArray} wordArray
|
||||
* @returns {Buffer} JS Buffer object
|
||||
*/
|
||||
wordArrayToBuffer(wordArray) {
|
||||
if (wordArray) return new Buffer.from(wordArray.toString(CryptoJS.enc.Hex), 'hex');
|
||||
else return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an IP address to a hexadecimal string (WTV)
|
||||
* @param {string} ip The IP address to convert
|
||||
|
||||
Reference in New Issue
Block a user