Giter VIP home page Giter VIP logo

Comments (6)

knqyf263 avatar knqyf263 commented on July 26, 2024

I think bytes.TrimRight should be replaced with bytes.TrimSuffi. I welcome contributions 👍
https://github.com/DmitriyLewen/go-rpmdb/blob/801cdbd76e632491a3be72951364749fffce5ca5/pkg/package.go#L237

from go-rpmdb.

eredwine avatar eredwine commented on July 26, 2024

I think bytes.TrimRight should be replaced with bytes.TrimSuffi. I welcome contributions 👍 https://github.com/DmitriyLewen/go-rpmdb/blob/801cdbd76e632491a3be72951364749fffce5ca5/pkg/package.go#L237

I don't think bytes.TrimSuffix would work either. MD5 checksums are always 16 bytes in size so any trimming would result in incomplete data.

from go-rpmdb.

knqyf263 avatar knqyf263 commented on July 26, 2024

It's terminated with null. Or isn't there null as it's not string?

from go-rpmdb.

eredwine avatar eredwine commented on July 26, 2024

Yea, I don't think there is a null since it is not a string. I checked the length of the byte slice and it is 16 bytes. So, that doesn't leave room for a null terminator since an MD5 checksum needs 16 bytes.

But, I could see doing something like ie.Data[0:16] in case there was one in some future version of the RPM spec.

from go-rpmdb.

knqyf263 avatar knqyf263 commented on July 26, 2024

OK

from go-rpmdb.

knqyf263 avatar knqyf263 commented on July 26, 2024

#45

from go-rpmdb.

Related Issues (6)

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.