Converting from Private Key to WIF, what am i missing? They say a image speaks louder then 1000 words so:



As you can see from the image above, this should work ?
What am i missing here? 

This is my encode function,
http://cryptocoinjs.com/modules/currency/coinstring/

I can confirm the private key spitted out is in correct format for if i do a dump i get:

$ ./src/d-cli dumpprivkey WRSybD94sWugjAQ89zyvbLsnw76ovCYEGo
BxkN86fdFBN75Aat3WCDs9w6NRHCMJJvvrDgb44Vcc23f96ohFZ5
The issue as suggest by Andrew was in the encode function.
After using https://www.npmjs.com/package/wif everything worked perfectly as intended.