Module: Spreadsheet::Excel::Password

### Home Classes Methods

### In Files

- lib/spreadsheet/excel/password_hash.rb

### Methods

- ::password_hash

### Files

- LICENSE.txt
- Manifest.txt

### Class/Module Index

Quicksearch

- Spreadsheet
- Spreadsheet::Column
- Spreadsheet::Compatibility
- Spreadsheet::Datatypes
- Spreadsheet::Encodings
- Spreadsheet::Errors
- Spreadsheet::Excel
- Spreadsheet::Excel::Error
- Spreadsheet::Excel::ExcelCompatibleWorkbook
- Spreadsheet::Excel::Internals
- Spreadsheet::Excel::Internals::Biff5
- Spreadsheet::Excel::Internals::Biff8
- Spreadsheet::Excel::Offset
- Spreadsheet::Excel::Password
- Spreadsheet::Excel::Reader
- Spreadsheet::Excel::Reader::Biff5
- Spreadsheet::Excel::Rgb
- Spreadsheet::Excel::Row
- Spreadsheet::Excel::SstEntry
- Spreadsheet::Excel::Workbook
- Spreadsheet::Excel::Worksheet
- Spreadsheet::Font
- Spreadsheet::Format
- Spreadsheet::Formula
- Spreadsheet::Helpers
- Spreadsheet::Link
- Spreadsheet::Note
- Spreadsheet::NoteObject
- Spreadsheet::ParseExcel
- Spreadsheet::ParseExcel::Worksheet
- Spreadsheet::ParseExcel::Worksheet::Cell
- Spreadsheet::Row
- Spreadsheet::Workbook
- Spreadsheet::Worksheet
- Spreadsheet::Writer

No matching classes.

# Spreadsheet::Excel::Password

### Public Class Methods

password_hash(password) click to toggle source

Makes an excel-compatible hash

    # File lib/spreadsheet/excel/password_hash.rb, line 7
    def password_hash(password)
      hash = 0
      password.chars.reverse_each { |chr| hash = rol15(hash ^ chr[0].ord) }
      hash ^ password.size ^ 0xCE4B
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.