Convert javascript value to binary to be placed into mysql -


i have column in mysql table of type binary(password). within object:

{     password: request.password }; 

each value in object string. how convert value password binary placed mysql row?

+------------+--------------+------+-----+-------------------+-------+ | field      | type         | null | key | default           | | +------------+--------------+------+-----+-------------------+-------+ | password   | binary(16)   | no   | pri |                   |       | +------------+--------------+------+-----+-------------------+-------+ 

use

var password = "abc"; var result = "";  function converttobinarystring(decimal){     return (decimal >>> 0).tostring(2); }  password.split('').foreach(function(char){ result += converttobinarystring(char.charcodeat(0)) })  console.log(result) // 110000111000101100011 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -