In tezos, I am able to get the tezos address starts with tz1 from the public key but I am unable to get the correct KT address.
I am using this code from github.https://github.com/TezTech/eztz/blob/master/src/main.js#L768
What is operationHash and ind? there is no comment to explain this. Is operationHash publicKey in edpk format or some other hashing?
hash : function(operationHash, ind){
var ob = utility.b58cdecode(operationHash, prefix.o), tt = [], i=0;
for(; i<ob.length; i++){
tt.push(ob[i]);
}
tt = tt.concat([
(ind & 0xff000000) >> 24,
(ind & 0x00ff0000) >> 16,
(ind & 0x0000ff00) >> 8,
(ind & 0x000000ff)
]);
return utility.b58cencode(library.sodium.crypto_generichash(20, new Uint8Array(tt)), prefix.KT);
},
Is there any npm package available which do this?
Thanks