Did I find the right examples for you? yes no

All Samples(110)  |  Call(63)  |  Derive(0)  |  Import(47)
This function follows from the following discussion:
http://groups.google.com/group/web2py-developers/browse_thread/thread/7fd5789a7da3f09

It works like uuid.uuid4 except that tries to use os.urandom() if possible
and it XORs the output with the tokens uniquely associated with this machine.

        def web2py_uuid(ctokens=UNPACKED_CTOKENS):
    """
    This function follows from the following discussion:
    http://groups.google.com/group/web2py-developers/browse_thread/thread/7fd5789a7da3f09

    It works like uuid.uuid4 except that tries to use os.urandom() if possible
    and it XORs the output with the tokens uniquely associated with this machine.
    """
    rand_longs = (random.getrandbits(64),random.getrandbits(64))
    if HAVE_URANDOM:
        urand_longs = struct.unpack('=QQ', fast_urandom16())
        byte_s = struct.pack('=QQ',
                             rand_longs[0]^urand_longs[0]^ctokens[0], 
                             rand_longs[1]^urand_longs[1]^ctokens[1])
    else:
        byte_s = struct.pack('=QQ', 
                             rand_longs[0]^ctokens[0], 
                             rand_longs[1]^ctokens[1])
    return str(uuid.UUID(bytes=byte_s, version=4))
        


src/f/l/flask-example-HEAD/dal.py   flask-example(Download)
###################################################################################
try:
    from utils import web2py_uuid
except ImportError:
    import uuid

src/o/p/openshift_web2py-HEAD/libs/gluon/globals.py   openshift_web2py(Download)
from serializers import json, custom_json
import settings
from utils import web2py_uuid, secure_dumps, secure_loads
from settings import global_settings
import hashlib
            self.client.replace(':', '_'),
            self.now.strftime('%Y-%m-%d.%H-%M-%S'),
            web2py_uuid())
        return self.uuid
 
            dbtables[k] = dict(defined=v['dbtables']['defined'] or '[no defined tables]',
                               lazy=v['dbtables']['lazy'] or '[no lazy tables]')
        u = web2py_uuid()
        backtotop = A('Back to top', _href="#totop-%s" % u)
        return DIV(
            client = request.client and request.client.replace(':', '.')
 
            uuid = web2py_uuid()
            response.session_id = '%s-%s' % (client, uuid)
            if separate:
                raise Exception('No record')
 
            unique_key = web2py_uuid()
            db(table.id == record_id).update(unique_key=unique_key)
            response.session_id = '%s:%s' % (record_id, unique_key)

src/o/p/openshift_web2py-HEAD/libs/gluon/html.py   openshift_web2py(Download)
 
from storage import Storage
from utils import web2py_uuid, simple_hash, compare
from highlight import highlight
 
            self['_data-w2p_disable_with'] = 'default'
        if self['callback'] and not self['_id']:
            self['_id'] = web2py_uuid()        
        if self['delete']:
            self['_data-w2p_remove'] = self['delete']
                formkey = self.record_hash
            else:
                formkey = web2py_uuid()
            self.formkey = session['_formkey[%s]' % formname] = formkey
        if status and not keepvalues:

src/o/p/openshift_web2py-HEAD/libs/gluon/validators.py   openshift_web2py(Download)
import unicodedata
from cStringIO import StringIO
from utils import simple_hash, web2py_uuid, DIGEST_ALG_BY_SIZE
from dal import FieldVirtual, FieldMethod
 

src/m/o/MobileBlur-HEAD/gluon/validators.py   MobileBlur(Download)
import unicodedata
from cStringIO import StringIO
from utils import simple_hash, hmac_hash, web2py_uuid
 
__all__ = [

src/w/e/web2py-2.1.1/gluon/html.py   web2py(Download)
 
from storage import Storage
from utils import web2py_uuid, simple_hash, compare
from highlight import highlight
 
                formkey = self.record_hash
            else:
                formkey = web2py_uuid()
            self.formkey = session['_formkey[%s]' % formname] = formkey
        if status and not keepvalues:

src/w/e/web2cms-HEAD/web2py/gluon/validators.py   web2cms(Download)
import unicodedata
from cStringIO import StringIO
from utils import simple_hash, hmac_hash, web2py_uuid
 
__all__ = [
    def __call__(self, value):
        if not value and self.min_length>0:
            value = web2py_uuid()
        elif len(value)<self.min_length:
            return ('',translate(self.error_message))

src/w/e/web2py-2.1.1/gluon/validators.py   web2py(Download)
import unicodedata
from cStringIO import StringIO
from utils import simple_hash, web2py_uuid, DIGEST_ALG_BY_SIZE
 
__all__ = [

src/g/l/gluino-HEAD/gluino/html.py   gluino(Download)
 
from storage import Storage
from utils import web2py_uuid, simple_hash, compare
from highlight import highlight
 
            self['_data-w2p_disable_with'] = 'default'
        if self['callback'] and not self['_id']:
            self['_id'] = web2py_uuid()        
        if self['delete']:
            self['_data-w2p_remove'] = self['delete']
                formkey = self.record_hash
            else:
                formkey = web2py_uuid()
            self.formkey = session['_formkey[%s]' % formname] = formkey
        if status and not keepvalues:

src/g/l/Gluino-0.4/gluino/html.py   Gluino(Download)
 
from storage import Storage
from utils import web2py_uuid, simple_hash, compare
from highlight import highlight
 
                formkey = self.record_hash
            else:
                formkey = web2py_uuid()
            self.formkey = session['_formkey[%s]' % formname] = formkey
        if status and not keepvalues:

  1 | 2 | 3 | 4 | 5  Next