## hash

#### OS/161 Reference Manual

### Name

hash - compute a simple hash function of a file

### Synopsis

/testbin/hash file
host-hash file

### Description

hash takes a file and computes a hash value for it by adding all the bytes in the file together modulo a prime.

hash is by default also compiled for the System/161 host OS so you can cross-check the answers you get.

### Requirements

hash uses the following system calls:

- open
- read
- write
- close
- _exit

Once the basic system calls are complete, hash should work on any file the system supports. However, it will probably of most use for testing while working on the file system assignment.