Tag:Decode

  • Traffic optimization of IOS client based on webp image format (Part one)

    Time:2021-1-12

    First of all, this is a component optimization scheme based on specific business. I try my best to separate the business logic from the code. Some local codes may be deleted. Now this scheme is used for a news application with multiple pictures. It is roughly estimated that users will consume 100 meters of traffic […]

  • Vue + vant add watermark before uploading image and compress image size

    Time:2020-12-29

    There’s no bullshit, just codeIn addition, theimage-conversionTo compress the image <template> <div class=”page”> <div> <van-uploader :accept=”‘image/*'” :before-read=”beforeRead” :after-read=”onUpload” > <! — < van button type = “primary” > main buttons < / Van button > — > </van-uploader> </div> <img :src=”imgUrl” style=”width: 100%”> </div> </template> <script> import { compressAccurately } from ‘image-conversion’ export default { […]

  • Detailed explanation of encoding and decoding of JSON data in PHP

    Time:2020-12-24

    This paper describes the implementation of PHP JSON data encoding and decoding operations. The details are as follows: Usage scenarios of JSON: A data table field needs to record multiple information, such as other information about users Data transmission, such as: return value of API interface, asynchronous loading in AJAX Configuration files, such as composer.json […]

  • C + + ffmpeg: h264, MJPEG to yuyv, RGB

    Time:2020-12-20

    Paste the code first and add it when you have time. H264ToRGB H264 is inter frame coding, and it needs to feed data to AVCodecContext in order to decode correctly. void H264ToRGB(unsigned char* data, unsigned int dataSize, unsigned char* outBuffer) { //Load metadata into packet 1 AVPacket* avPkt = av_packet_alloc(); avPkt->size = dataSize; avPkt->data = […]

  • [ffmpeg] AV_ PKT_ FLAG_ DISCARD

    Time:2020-12-11

    Record what you stepped onAV_PKT_FLAG_DISCARDA pit. background Make oneTake frameCan pass in the specified time and get the frame of the time point. The implementation steps are as follows: Get video stream’sduration 。Because some of the format of the material needs to be adapted, so here is through thepkt->pts + pkt->durationThe maximum value of. according […]

  • Koa JWT documentation (machine retouching)

    Time:2020-10-28

    Koa-jwt node>=7.6.0 npm v3.2.2 This module allows you to authenticate HTTP requests in your koa application by using JSON web token (hereinafter referred to as JWT) This document gives a good introduction If you use koa version 2. +, and you have a node. Installation earlier than 7.6 [email protected] The koa JWT version 3 + […]

  • Popular explanation of JWT authentication scenarios and structure security

    Time:2020-10-13

    1、 Defects of application development based on session In our traditional BS application development mode, session is used for state management, such as saving login, user, permission and other state information. The principle of this method is as follows: After the user logs in, the status information is saved to the session. The server automatically […]

  • What you should know about JWT

    Time:2020-10-2

    What is JWT? The full name of JWT is JSON web token, which is a very lightweight specification. This specification allows us to use JWT to deliver secure and reliable information between users and servers. JWT usage scenarios jwtExtensive use of pictures, such asto grant authorization、authentication Etc. To be more specific, if a user a […]

  • TCP packet sticking and its solution — Based on NewLife.Net Pipeline frame length gluing method for Network Library

    Time:2020-9-27

    catalog 1. Sticking 2. Sticking reasons 2.1. The same client sends continuously 2.2. Packet sticking caused by network congestion 2.3. The server is stuck 3. The harm of sticking package 3.1. The packet cannot be parsed correctly 3.2. Error packets are parsed by errors 3.3. Enter the dead loop 4. Logical processing method of gluing […]

  • Improved high performance token protocol based on JWT protocol

    Time:2020-9-23

    preface I believe you all know that JWT (JSON web token) protocol (if you don’t know it well, you can look at it for 10 minutes to learn about JSON web token (JWT)) is currently used in the industry for cross domain authentication. However, due to the low parsing performance of JSON, many performance problems […]

  • Learn bypass CSP record

    Time:2020-9-18

    Recently, I saw a Bypas CSP record, and then I learned it again Configure CSP Here, set the HTML header directly to achieve the effect of configuring CSP. Content-Security-Policy: script-src ‘self’ ‘unsafe-inline’ Create HTML and load JS. The code is as follows, It can be executed normally Change JS to external JS You can see […]

  • Performance optimization of Dubbo and Dubbo go Hessian 2 in mosn

    Time:2020-9-9

    background Ant financial has high requirements for the stability and performance of service mesh, and the internal mosn is widely used in production environment. In the cloud and open source community, Dubbo and spring cloud are also widely used in production environment in RPC field. We support Dubbo and spring cloud traffic agents on the […]