From https://github.com/bitwiseshiftleft/sjcl