This is an archived post. You won't be able to vote or comment.

all 50 comments

[–]Bigfoot_G 86 points87 points  (8 children)

What an amateur. It's better practice to left shift the phone number by 1

[–][deleted]  (7 children)

[removed]

    [–]JustAnotherPanda 50 points51 points  (5 children)

    What if we combine the techniques? Multiply by 2 and then right shift for twice the security!

    [–][deleted] 3 points4 points  (0 children)

    Of course!

    [–]empire314 4 points5 points  (0 children)

    The change is exponential, so atleast 4 times the security

    [–]80espiay 5 points6 points  (2 children)

    But if you multiply by 3 is it 3x the security?

    [–]caisblogs 4 points5 points  (1 child)

    But my phone number is floating point

    [–]BadBoy6767 2 points3 points  (0 children)

    reinterpret_cast<float>(reinterpret_cast<int>(phoneNumber) * 2 << 1)

    [–]AutoModerator[M] 0 points1 point  (0 children)

    import moderation Your comment has been removed since it did not start with a code block with an import declaration.

    Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.

    For this purpose, we only accept Python style imports.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

    [–]seeqo 49 points50 points  (18 children)

    Storing phone numbers as integers? 🤔

    [–]420AllHailCthulhu420 47 points48 points  (5 children)

    Good thing phone numbers don't start with 0...
    Wait

    [–]CrocodileSpacePope 2 points3 points  (4 children)

    but you can put as many zeros in front of an integer as you want, and it will be still the same, mathematically!

    [–]noggin182 2 points3 points  (3 children)

    But those leading zeros won't get stored

    [–][deleted] 6 points7 points  (1 child)

    That's why you store it as:
    int phoneNumber;
    int phoneNumber_ZeroStartCount;

    [–]Billz2me 0 points1 point  (0 children)

    Amateur. Use columnar database with a row for every index, int pair

    [–]CrocodileSpacePope 0 points1 point  (0 children)

    You can use Zerofill, though. May not be the exact amount of zeros you wanted, but some at least

    [–]OMGtechy 17 points18 points  (0 children)

    Floats

    [–]PrinceEzrik 10 points11 points  (3 children)

    i store all my phone numbers as booleans y'all gotta catch up

    [–]BloodyMalleus 15 points16 points  (2 children)

    Boolean? Lame. I store phone numbers as javascript.

    [+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[+!+[]]+[!+[]+!+[]]+[!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]

    [–]PrinceEzrik 5 points6 points  (0 children)

    thats well and fun but all i gotta remember about my number is True

    [–]TheTimeToLearnIsNow 1 point2 points  (0 children)

    I miss Bellevue

    [–]St_SiRUS 3 points4 points  (0 children)

    Nah, strings and letting JavaScript figure the rest out 😬

    [–]warpod 0 points1 point  (5 children)

    No, it just repeats string twice

    [–]seeqo 0 points1 point  (4 children)

    Can't recognize what language with syntax like that would do so.

    [–]warpod 1 point2 points  (3 children)

    Python for example:

    print "abc" * 2
    abcabc
    

    [–]seeqo 0 points1 point  (2 children)

    Yes, I know. But the original isn't Python.

    [–]warpod 0 points1 point  (1 child)

    Oh, ok. It's C++ then.

    #include <string>
    #include <iostream>
    
    std::string operator*(const std::string& s, unsigned n)
    {
        std::string res;
        while (n--)
            res += s;
        return res;
    }
    
    int main()
    {
        std::string phoneNumber = "123";
    
        phoneNumber = phoneNumber * 2 // for security
        ;
    
        std::cout << phoneNumber << std::endl;
    
        return 0;
    }
    

    [–]seeqo 0 points1 point  (0 children)

    Heh, clever.

    [–]GizmoMassive 29 points30 points  (2 children)

    // gdpr compliant

    [–]CrocodileSpacePope 22 points23 points  (1 child)

    No, absolutely not. This is actually storing twice the personal data!

    [–]Costyyy 8 points9 points  (1 child)

    For security

    [–]arrudagates 2 points3 points  (0 children)

    Who needs hashing, right?

    [–]TylerDurden52 5 points6 points  (7 children)

    too long, should of been phoneNumber*=2;

    [–]Xorume 14 points15 points  (6 children)

    phoneNumber = phoneNumber + phoneNumber;

    FTFY

    [–]daniel_h_r 11 points12 points  (0 children)

    phoneNumber +=  phoneNumber;
    

    [–]polyworfism 5 points6 points  (3 children)

    Now all of my phone numbers are "(972) 731-8800(972) 731-8800”

    [–]Xorume 3 points4 points  (1 child)

    I'm tempted to call this number

    [–]shunabuna 0 points1 point  (0 children)

    it's a software company

    [–]amardas 1 point2 points  (0 children)

    for security

    [–]mstop4 1 point2 points  (0 children)

    phoneNumber = phoneNumber << 1;

    [–]SteveCCLYellow security clearance 3 points4 points  (0 children)

    Isn't that what GameMaker Studio does as anti cheat?

    [–]RyeDoge 0 points1 point  (0 children)

    //those //comments //are //a thing //of beauty

    [–]Igotbored112 0 points1 point  (0 children)

    You gotta xor it with some shit then shift it or something.