Framework

- About
- Guides
- Community
- API
- Code
- Download

# Kanso API Documentation

Index | View on single page

## sha1

A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined in FIPS PUB 180-1. This module is used to hash user passwords in a way that's compatible with CouchDB.

This module is Copyright Paul Johnston 2000 - 2002 and distributed under the BSD License. See http://pajhome.org.uk/crypt/md5 for details.

### hex(s)

Hashes a string using SHA1 and returns a hex representation of it.

#### Parameters

s | String |

Returns: String

### base64(s)

Hashes a string using SHA1 and returns a base64 representation of it.

#### Parameters

s | String |

Returns: String

### str(s)

Hashes a string using SHA1 and returns a string representation of it.

#### Parameters

s | String |

Returns: String

### hex_hmac(key, data)

Calculates the HMAC-SHA1 of a key and some data, returning a hex representation of it.

#### Parameters

key | String |
data | String |

Returns: String

### base64_hmac(key, data)

Calculates the HMAC-SHA1 of a key and some data, returning a base64 representation of it.

#### Parameters

key | String |
data | String |

Returns: String

### str_hmac(key, data)

Calculates the HMAC-SHA1 of a key and some data, returning a string representation of it.

#### Parameters

key | String |
data | String |

Returns: String