Python Forum
Code that generates MD5 hashes from IPv6 addresses giving differant answers?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code that generates MD5 hashes from IPv6 addresses giving differant answers?
#5
(Oct-16-2016, 02:59 AM)Larz60+ Wrote: Hello,

You are correct, the u is for unsigned character. It originated in C as a data type, originally for an 8 bit byte, where you wanted to use the full 255 possible values.
Without it, the range would be  -128 to 127.
it's for unsigned (int is implied ... 32 bit in common platforms) in C.  and works that way in Py, too:

Output:
lt1/forums /home/forums 10> py2 Python 2.7.12 (default, Jul  1 2016, 15:12:24) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> '%u' % (2**30,) '1073741824' >>> lt1/forums /home/forums 11> py3 Python 3.5.2 (default, Sep 10 2016, 08:21:44) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> '%u' % (2**30,) '1073741824' >>>
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
RE: One of these things is not like the other... - by Skaperen - Oct-17-2016, 02:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  'answers 2' is not defined on line 27 0814uu 4 839 Sep-02-2023, 11:02 PM
Last Post: 0814uu
  Compiles Python code with no error but giving out no output - what's wrong with it? pythonflea 6 1,727 Mar-27-2023, 07:38 AM
Last Post: buran
  Non cryptographic hashes AndrzejB 3 915 Mar-21-2023, 07:36 PM
Last Post: AndrzejB
  unittest generates multiple files for each of my test case, how do I change to 1 file zsousa 0 1,022 Feb-15-2023, 05:34 PM
Last Post: zsousa
  a function to get IP addresses of interfaces Skaperen 2 1,511 May-30-2022, 05:00 PM
Last Post: Skaperen
  Loop through list of ip-addresses [SOLVED] AlphaInc 7 4,245 May-11-2022, 02:23 PM
Last Post: menator01
  Division calcuation with answers to 1decimal place. sik 3 2,223 Jul-15-2021, 08:15 AM
Last Post: DeaD_EyE
  instance methods sharing addresses mim 1 2,302 Mar-28-2021, 05:22 AM
Last Post: deanhystad
  Convert email addresses to VCF format jehoshua 2 4,782 Mar-06-2021, 12:50 AM
Last Post: jehoshua
  Cannot Assign right Answers To Shuffled Questions Boblows 6 2,869 Jan-22-2021, 09:41 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020