new_contents: #!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  # === bitcoin.crypto ------------------------------------------------------===
  # Copyright © 2012, RokuSigma Inc. and contributors as an unpublished work.
  # See AUTHORS for details.
  #
  # RokuSigma Inc. (the “Company”) Confidential
  #
  # NOTICE: All information contained herein is, and remains the property of the
  # Company. The intellectual and technical concepts contained herein are
  # proprietary to the Company and may be covered by U.S. and Foreign Patents,
  # patents in process, and are protected by trade secret or copyright law.
  # Dissemination of this information or reproduction of this material is
  # strictly forbidden unless prior written permission is obtained from the
  # Company. Access to the source code contained herein is hereby forbidden to
  # anyone except current Company employees, managers or contractors who have
  # executed Confidentiality and Non-disclosure agreements explicitly covering
  # such access.
  #
  # The copyright notice above does not evidence any actual or intended
  # publication or disclosure of this source code, which includes information
  # that is confidential and/or proprietary, and is a trade secret, of the
  # Company. ANY REPRODUCTION, MODIFICATION, DISTRIBUTION, PUBLIC PERFORMANCE,
  # OR PUBLIC DISPLAY OF OR THROUGH USE OF THIS SOURCE CODE WITHOUT THE EXPRESS
  # WRITTEN CONSENT OF THE COMPANY IS STRICTLY PROHIBITED, AND IN VIOLATION OF
  # APPLICABLE LAWS AND INTERNATIONAL TREATIES. THE RECEIPT OR POSSESSION OF
  # THIS SOURCE CODE AND/OR RELATED INFORMATION DOES NOT CONVEY OR IMPLY ANY
  # RIGHTS TO REPRODUCE, DISCLOSE OR DISTRIBUTE ITS CONTENTS, OR TO MANUFACTURE,
  # USE, OR SELL ANYTHING THAT IT MAY DESCRIBE, IN WHOLE OR IN PART.
  # ===----------------------------------------------------------------------===
  
  # ===----------------------------------------------------------------------===
  # This file is based in part on code published as part of the pynode project.
  # The original work is copyrighted by it's authors and licensed according to
  # the terms of the MIT license (below); modifications since then are the
  # property of RokuSigma Inc. and subject to the above-referenced
  # confidentiality and non-disclosure agreements.
  # ===----------------------------------------------------------------------===
  
  # ===----------------------------------------------------------------------===
  # Permission is hereby granted, free of charge, to any person obtaining a copy
  # of this software and associated documentation files (the "Software"), to deal
  # in the Software without restriction, including without limitation the rights
  # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  # copies of the Software, and to permit persons to whom the Software is
  # furnished to do so, subject to the following conditions:
  #
  # The above copyright notice and this permission notice shall be included in
  # all copies or substantial portions of the Software.
  #
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  # THE SOFTWARE.
  # ===----------------------------------------------------------------------===
  
  import hashlib
  
  try:
      from cStringIO import StringIO
  except:
      from StringIO import StringIO
  
  from .serialization import deserialize_hash
  
  def hash256(str_):
      hash_ = hashlib.sha256(hashlib.sha256(str_).digest()).digest()
      return deserialize_hash(StringIO(hash_), 32)
  
  def hash160(str_):
      h = hashlib.new('ripemd160')
      hash_ = h.update(hashlib.sha256(str_).digest()).digest()
      return deserialize_hash(StringIO(hash_), 20)
  
  # ===----------------------------------------------------------------------===
  # End of File
  # ===----------------------------------------------------------------------===
  
subject: Add cryptographic hashing functions.