Updated for npm
Updated to be node.js compatible
Pad with unicode nul instead of 0