methods for hashing, compressing, and encoding bytes