node.js - nodejs convert string like php pack function -


i trying convert string ascii

in php:

>>> pack('h*', '123') => "\x120" 

how same thing in nodejs?

i trying use https://github.com/peze/node-pack package pack result following :

> pack.pack('h*', '123')   outputpos=2 <buffer 12 30> 


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -