Typo fixes

This commit is contained in:
Kagami Hiiragi 2014-12-28 00:04:23 +03:00
parent 22cc03604f
commit a47563ee8c
4 changed files with 13 additions and 13 deletions

View File

@ -69,7 +69,7 @@ function getchecksum(data) {
});
}
// Get RIPEMD160(SHA512(SIGN_PUBLIC_KEY || ENC_PUBLIC_KEY))
// Get RIPEMD160(SHA512(SIGN_PUBLIC_KEY || ENC_PUBLIC_KEY)).
// Arguments could be either private or public keys. Private keys are
// **always** 32 bytes in length.
function keys2ripe(signKey, encKey) {
@ -122,7 +122,7 @@ function assertstream(stream) {
assert(stream, "No stream");
}
// Get truncated ripe hash length.
// Get truncated Ripe hash length.
function getripelen(ripe) {
var zeroes = 0;
for (var i = 0; i < 20, ripe[i] === 0; i++) {
@ -131,7 +131,7 @@ function getripelen(ripe) {
return 20 - zeroes;
}
// Do neccessary checkings of the truncated ripe hash length depending
// Do neccessary checkings of the truncated Ripe hash length depending
// on the address version.
function assertripelen(ripelen, version) {
switch (version) {
@ -152,7 +152,7 @@ function assertripelen(ripelen, version) {
}
}
// The same as `assertripelen` but return true/false instead of throw an
// The same as `assertripelen` but return boolean instead of thrown an
// Error.
function checkripelen(ripelen, version) {
try {
@ -210,8 +210,8 @@ exports.encode = function(addr) {
*/
exports.getRandom = function(opts) {
var version, stream, ripelen, signPrivateKey;
opts = opts || {};
try {
opts = opts || {};
version = opts.version || 4;
assertversion(version);
stream = opts.stream || 1;
@ -224,12 +224,12 @@ exports.getRandom = function(opts) {
} catch(e) {
return Promise.reject(e);
}
var nextTick = typeof setImmediate === "undefined" ?
process.nextTick :
setImmediate;
// Should the generated Ripe length be strictly equal to the specified
// (less-or-equal by default);
var strictripelen = !!opts.strictripelen;
var nextTick = typeof setImmediate === "undefined" ?
process.nextTick :
setImmediate;
var signPublicKey = bmcrypto.getPublic(signPrivateKey);
// FIXME(Kagami): This function is rather slow in browsers so

View File

@ -29,8 +29,8 @@ exports.sha256 = function(buf) {
};
exports.ripemd160 = function(buf) {
// XXX(Kagami): No support in browsers via Web Crypto API currently,
// so use module.
// XXX(Kagami): RIPEMD is not defined in WebCryptoAPI so we provide it
// using pure JS third-party implementation.
return Promise.resolve(ripemd160(buf));
};

View File

@ -1,6 +1,6 @@
/**
* Isomorphic Bitmessage crypto module. Reexport platform-specific
* functions and also export some common routines.
* Isomorphic Bitmessage crypto module. Reexports platform-specific
* functions and also some common routines.
* @module bitmessage/crypto
*/

View File

@ -1,5 +1,5 @@
/**
* Main Bitmessage module. Just reexports all public submodules.
* Main Bitmessage module. Just reexports all main submodules.
* @module bitmessage
*/