Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
daboth committed Jul 17, 2015
2 parents 4d9ed63 6ce9b7b commit 9bf3a0c
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 40,22 @@ piece of cake | ![piece of cake](/images/piece of cake.png)
hash me if you can | ![hash me if you can](/images/hash me if you can.png)

###Usage example:

# Acquire an arbitrary string.
inpt = 'pagan'

# Use pagan to generate the avatar images based on the input.
# Optional: You can choose, which hash function should be used.
# Default is HASH_SHA256.
img = generate_avatar(inpt, HASH_SHA512)

# Set a filename.
filename = ("output/%s.png" % inpt)

# Save the image to file. Look up the Python PIL Documentation
# for further information about image save functions.
img.save(filename, 'PNG', transparency=0)

```python
# Acquire an arbitrary string.
inpt = 'pagan'

# Use pagan to generate the avatar images based on the input.
# Optional: You can choose, which hash function should be used.
# Default is HASH_SHA256.
img = generate_avatar(inpt, HASH_SHA512)

# Set a filename.
filename = ("output/%s.png" % inpt)

# Save the image to file. Look up the Python PIL Documentation
# for further information about image save functions.
img.save(filename, 'PNG', transparency=0)
```

###Supported Hashes

Expand Down

0 comments on commit 9bf3a0c

Please sign in to comment.