Code Monkey home page Code Monkey logo

pi-feeder's Introduction

pi-feeder's People

Contributors

afollestad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pi-feeder's Issues

TypeError: Unicode-objects must be encoded before hashing

I was receiving the error at the bottom of this post when running server.py. I ended up having to edit auth.py and change the plain_text_password being passed to bcrypt to add .encode('utf8'). See the code sample below.

def get_hashed_password(plain_text_password):
    """Hashes a new password."""
    return bcrypt.hashpw(plain_text_password.encode('utf8'), bcrypt.gensalt())

def check_password(plain_text_password, hashed_password):
    """Compares a plain-text password to a hashed password."""
    return bcrypt.checkpw(plain_text_password.encode('utf8'), hashed_password)`
Traceback (most recent call last):
  File "server.py", line 210, in <module>
    auth.init_auth()
  File "/home/pi/pi-feeder/auth.py", line 49, in init_auth
    hashed_pswd = get_hashed_password('feeder')
  File "/home/pi/pi-feeder/auth.py", line 13, in get_hashed_password
    return bcrypt.hashpw(plain_text_password, bcrypt.gensalt())
  File "/usr/local/lib/python3.4/dist-packages/bcrypt/__init__.py", line 62, in                                      hashpw
    raise TypeError("Unicode-objects must be encoded before hashing")
TypeError: Unicode-objects must be encoded before hashing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.