Answers for "eosio name to int js"

0

eosio name to int js

import { createInitialTypes, SerialBuffer } from 'eosjs/dist/eosjs-serialize';
convertName(name){
  const builtinTypes = createInitialTypes()
  const typeUint64 = builtinTypes.get("uint64")
  const typeName = builtinTypes.get("name")
  var buffer = new SerialBuffer({ textDecoder: new TextDecoder(), textEncoder: new TextEncoder() });

  typeName.serialize(buffer, name)
  return typeUint64.deserialize(buffer)
}

console.log(convertName("hossainiiiir"));
Posted by: Guest on October-20-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language