ó
i4Vdc        
   @   s^   d  Z  d g Z d d l Z d d l m Z d d l m Z e j d e ƒ d Z d „  Z	 d S(   s   
Common checksum routines.
t   luhniÿÿÿÿN(   t   six(   t   RemovedInDjango110Warningsv   django.utils.checksums will be removed in Django 1.10. The luhn() function is now included in django-localflavor 1.1+.i    i   i   i   i   i   i   i   i   i	   c         C   s–   t  |  t j ƒ s! t |  ƒ }  n  y\ t d „  |  d d d … Dƒ ƒ } t d „  |  d d d … Dƒ ƒ } | | d d k SWn t k
 r‘ t SXd S(   s½   
    Checks a candidate number for validity according to the Luhn
    algorithm (used in validation of, for example, credit cards).
    Both numeric and string candidates are accepted.
    c         s   s   |  ] } t  | ƒ Vq d  S(   N(   t   int(   t   .0t   c(    (    sd   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/checksums.pys	   <genexpr>   s    iÿÿÿÿNiþÿÿÿc         s   s   |  ] } t  t | ƒ Vq d  S(   N(   t   LUHN_ODD_LOOKUPR   (   R   R   (    (    sd   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/checksums.pys	   <genexpr>   s    i
   i    (   t
   isinstanceR   t   string_typest   strt   sumt
   ValueErrort   False(   t	   candidatet   evenst   odds(    (    sd   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/checksums.pyR       s    ##(
   i    i   i   i   i   i   i   i   i   i	   (
   t   __doc__t   __all__t   warningst   django.utilsR   t   django.utils.deprecationR   t   warnR   R    (    (    (    sd   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/utils/checksums.pyt   <module>   s   	