Code Monkey home page Code Monkey logo

cidr-utils's Introduction

Hi, welcome to my Github pages.

Things Related to My Projects

Rust JavaScript TypeScript Java C PHP Golang Bash

Ubuntu Server Linux Mint Android Windows

Tokio Rocket Axum napi-rs iced Node.js Webpack Express Fastify NestJS + Fastify Bootstrap Vite Vue.js Handlebars Tera Sass Nginx Apache httpd Docker

MySQL SQLite MongoDB Redis

cidr-utils's People

Contributors

alexgartrell avatar dbcfd avatar dependabot[bot] avatar kornelski avatar lee-hen avatar magiclen avatar robjtede avatar wspeirs avatar yotamofek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cidr-utils's Issues

Incorrect value for cidr first/last

Given the following example:

use cidr_utils::cidr::IpCidr;

fn main() {
    let cidr = IpCidr::from_str("100.64.0.0/10");

    match cidr {
        Ok(IpCidr::V4(cidr)) => {
            println!("{:?} {:?}", cidr.first(), cidr.last());
            println!("{:?} {:?}", cidr.first_as_ipv4_addr(), cidr.last_as_ipv4_addr());
            println!("{:?} {:?}", u32::from(cidr.first_as_ipv4_addr()), u32::from(cidr.last_as_ipv4_addr()));
        },
        _ => {},
    }
}

It prints the following:

16484 4294934372
100.64.0.0 100.127.255.255
1681915904 1686110207

The value for cidr last seems wrong, it should be 1686110207

Edit* The value for first also seems wrong, I've updated the example to show the u32 conversions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.