1# Copyright (c) 2012 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5"""Bogus fingerprint implementation, do not use for production,
6provided only as an example.
7
8Usage:
9    grit.py -h grit.extern.BogoFP xmb /tmp/foo
10"""
11
12from __future__ import print_function
13
14import grit.extern.FP
15
16
17def UnsignedFingerPrint(str, encoding='utf-8'):
18  """Generate a fingerprint not intended for production from str (it
19  reduces the precision of the production fingerprint by one bit).
20  """
21  return (0xFFFFF7FFFFFFFFFF &
22          grit.extern.FP._UnsignedFingerPrintImpl(str, encoding))
23