Giter Site home page Giter Site logo

tedd.spanutils's People

Contributors

stefh avatar tedd avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kopffarben stefh

tedd.spanutils's Issues

The TargetFrameworks doesn't need to include all frameworks, just add the minimum

Change this

<TargetFrameworks>net461;net462;net47;net471;net472;net48;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0</TargetFrameworks>

Into

<TargetFrameworks>net461;netstandard2.0;netstandard2.1</TargetFrameworks>

Info:

  • net461 is the lowest framework, and can be used by net462 net47 net471 net472 net48
  • netstandard2.0 --> This can be used by net471 and higher, and off course by netcoreapp2.x, 3.x and net5.0
  • netstandard2.0 --> This can be used by netcoreapp3.x and net5.0 (it's not really needed to provide this one, but my personal preference is to include this one also)

Benchmark integer copying

.netstandard 2.0

Can you please make your library compatible with .net standard 2.0 ?

More datatypes

  • Bool
  • Char
  • Char-array
  • Float
  • Double
  • Decimal
  • DateTime
  • TimeSpan?
  • BitArray?

Optimize float, double and decimal

SpanStream v.s. BinaryReader & BinaryWriter

Hello @tedd ,

I thought that the SpanStream could be used to replace BinaryReader and BinaryWriter, however this does not work because the byte storing is reversed.

Your code

public static UInt32 ReadUInt32(this Span<byte> span)
        {
            // return MemoryMarshal.Cast<byte, UInt32>(span)[0];
            return (UInt32)(
                ((UInt32)span[3])
                | ((UInt32)span[2] << (8 * 1))
                | ((UInt32)span[1] << (8 * 2))
                | ((UInt32)span[0] << (8 * 3))
                );
        }

Code from BinaryReader (https://referencesource.microsoft.com/#mscorlib/system/io/binaryreader.cs,185)

return (int)(m_buffer[0] | m_buffer[1] << 8 | m_buffer[2] << 16 | m_buffer[3] << 24);

Is this intentional?

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.