Re: Let's share some useful Python code

Hi,
Thanks for that, sad, and sorry it's a bit of a mess.
First, the reason I hashed the key was so that you can use a key of any length.
Pickle is used to store data that tells the pack file how to retrieve files that are stored in the pack.
The key is to my knowledge *not* hardcoded. It takes a key from the user, turns it into bytes, hashes it so you can use a key of any length, and then it uses that hash as the key.
I did just make some changes, redownload from post 1:
Add_file() removed, use add() instead
Nonce now random, not really stored in the code it's self.
You can pass an optional parameter, level, to the constructor. It's used when compressing the data the higher the smaller data and the longer the time.
Removed all print statements that were there for testing, whoops!
Removed delete, it's broken and wasn't listed in the docs anyway. It's supposed to remove a file, but it removes you're ability to read data from the pack file instead.
By the way, you can index a pack file instance like a dictionary to get a raw bytes object that holds the data of a file, if you don't want to extract it.
I'm not sure what'd you could do with this to play a sound. You'd need to find a sound lib that takes stuff straight from memory or add that you're self.


I hope the pack now works better!

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector

Reply via email to