Skip to content

Commit

Permalink
Create string_utils.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 8, 2024
1 parent 0479e31 commit 2589cd4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions blockchain_integration/pi_network/PiShield/utils/string_utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class StringUtils {
hexToString(hex) {
return Buffer.from(hex, 'hex').toString('utf8');
}

stringToHex(str) {
return Buffer.from(str, 'utf8').toString('hex');
}
}

module.exports = StringUtils;

0 comments on commit 2589cd4

Please sign in to comment.