Object/Trait

io.scalajs.npm.bcrypt

Bcrypt

Related Docs: trait Bcrypt | package bcrypt

Permalink

object Bcrypt extends Object with Bcrypt

Native JS implementation of BCrypt for Node. Has the same functionality as node.bcrypt.js expect for a few tiny differences. Mainly, it doesn't let you set the seed length for creating the random byte array.

I created this version due to a small problem I faced with node.bcrypt.js. Basically, to deploy one of my apps which uses node.bcrypt.js on a winx64 platform, I have to force the user to download about 1.6gb of sdks, buildtools and other requirements of which some fail to install ! Microsoft :(

This code is based on javascript-bcrypt and uses [crypto] (http://nodejs.org/api/crypto.html) to create random byte arrays.

Annotations
@native() @JSImport( "bcrypt" , JSImport.Namespace )
Version

1.0.2

See also

https://www.npmjs.com/package/bcrypt-nodejs

Linear Supertypes
Bcrypt, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Bcrypt
  2. Bcrypt
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def compare(data: Any, encrypted: Hash, callback: Function2[BCryptError, Boolean, Any]): Unit

    Permalink

    Asynchronously compares the hash to the given data

    Asynchronously compares the hash to the given data

    data

    the given data to be compared

    encrypted

    the encrypted data to be compared to.

    callback

    the error/result callback

    Definition Classes
    Bcrypt
    Example:
    1. bcrypt.compare("bacon", hash, function(err, res) {})

  7. def compare(data: Any, encrypted: Hash): Promise[Boolean]

    Permalink

    Asynchronously compares the hash to the given data

    Asynchronously compares the hash to the given data

    data

    the given data to be compared

    encrypted

    the encrypted data to be compared to.

    returns

    the promise of a result

    Definition Classes
    Bcrypt
    Example:
    1. bcrypt.compare("bacon", hash)

  8. def compareSync(data: Any, encrypted: Hash): Boolean

    Permalink

    Synchronously compares the hash to the given data

    Synchronously compares the hash to the given data

    data

    the given data to be compared

    encrypted

    the encrypted data to be compared to.

    Definition Classes
    Bcrypt
    Example:
    1. bcrypt.compareSync("veggies", hash); // false

  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def genSalt(rounds: Int = js.native, callback: Function2[BCryptError, Salt, Any]): Unit

    Permalink

    Asynchronously generates the salt

    Asynchronously generates the salt

    rounds

    the number of rounds to process the data for. (default - 10)

    callback

    the error/result callback

    Definition Classes
    Bcrypt
  13. def genSalt(rounds: Int): Promise[Salt]

    Permalink

    Asynchronously generates the salt

    Asynchronously generates the salt

    rounds

    the number of rounds to process the data for. (default - 10)

    returns

    the generated salt

    Definition Classes
    Bcrypt
  14. def genSalt(): Promise[Salt]

    Permalink

    Asynchronously generates the salt

    Asynchronously generates the salt

    returns

    the generated salt

    Definition Classes
    Bcrypt
  15. def genSaltSync(rounds: Int = js.native): Salt

    Permalink

    Synchronously generates the salt

    Synchronously generates the salt

    rounds

    the number of rounds to process the data for. (default - 10)

    Definition Classes
    Bcrypt
    Example:
    1. bcrypt.genSaltSync(rounds)

  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def getRounds(encrypted: Hash): Int

    Permalink

    Returns the number of rounds used to encrypt a given hash

    Returns the number of rounds used to encrypt a given hash

    encrypted

    hash from which the number of rounds used should be extracted.

    returns

    the number of rounds used to encrypt a given hash

    Definition Classes
    Bcrypt
    Example:
    1. bcrypt.getRounds(encrypted)

  18. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  19. def hash(data: Any, salt: Salt, callback: Function2[BCryptError, Hash, Any]): Unit

    Permalink

    Asynchronously creates a hash using the given data

    Asynchronously creates a hash using the given data

    data

    the given data to be hashed

    salt

    the salt to be used to hash the password.

    callback

    a callback to be fired once the data has been encrypted.

    Definition Classes
    Bcrypt
    Example:
    1. bcrypt.hash(data, salt, progress, cb)

  20. def hash(data: Any, salt: Salt, progress: Function, callback: Function2[BCryptError, Hash, Any]): Unit

    Permalink

    Asynchronously creates a hash using the given data

    Asynchronously creates a hash using the given data

    data

    the given data to be hashed

    salt

    the salt to be used to hash the password.

    progress

    a callback to be called during the hash calculation to signify progress

    callback

    a callback to be fired once the data has been encrypted.

    Definition Classes
    Bcrypt
    Example:
    1. bcrypt.hash(data, salt, progress, cb)

  21. def hash(data: Any, salt: Salt): Promise[Hash]

    Permalink

    Asynchronously creates a hash using the given data

    Asynchronously creates a hash using the given data

    data

    the given data to be hashed

    salt

    the salt to be used to hash the password.

    returns

    the promise of the hash

    Definition Classes
    Bcrypt
    Example:
    1. bcrypt.hash(data, salt)

  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. def hashSync(data: Any, salt: Salt): Hash

    Permalink

    Synchronously creates a hash using the given data

    Synchronously creates a hash using the given data

    data

    the given data to be hashed

    Definition Classes
    Bcrypt
    Example:
    1. bcrypt.hashSync("bacon")

  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  26. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  32. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  33. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  34. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Bcrypt

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped